Skip to content

Conversation

@gonfunko
Copy link
Contributor

@gonfunko gonfunko commented Dec 4, 2025

The basics

The details

Resolves

Fixes part of #9496

Proposed Changes

This PR makes the looping behavior in LineCursor configurable. Although getPreviousNode() and getNextNode() already allowed configuring this, in(), out(), prev() and next() did not. This PR keeps the existing behavior, but will allow the keyboard experiment to disable looping and play an alert when the end of the navigable tree is reached.

@gonfunko gonfunko requested a review from maribethb December 4, 2025 20:40
@github-actions github-actions bot added the PR: feature Adds a feature label Dec 4, 2025
): IFocusableNode | null {
if (!node || (!loop && this.getLastNode() === node)) return null;
const originalLoop = this.getNavigationLoops();
this.setNavigationLoops(loop);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this whole rigamarole is unfortunate, is the loop parameter in getNextNode already released? should we just deprecate it? or potentially should get navigationLoops policy be made part of the navigation policy instead and it can pass that value into here? (This suggestion may not make sense, I forget which order these calls happen in, let me know if you want me to dig in further to find a proposal that might make more sense)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I don't super love it, but yes that argument is public already, hence this stack-y thing. I think the cursor feels like the right level to control this (the navigation policies should just be given X, what's the next/previous thing? with filtering and larger-scale behavior delegated to the cursor), but the existence of this argument does complicate it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment with a TODO so we can come back to this when we're designing the eventual "real" solution? The argument should probably just be removed at that point

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, and yeah if we're comfortable doing that that SGTM.

@gonfunko gonfunko requested a review from a team as a code owner December 5, 2025 22:18
@gonfunko gonfunko requested review from BenHenning and removed request for a team December 5, 2025 22:18
@gonfunko gonfunko merged commit 8522bff into add-screen-reader-support-experimental Dec 5, 2025
9 of 12 checks passed
@gonfunko gonfunko deleted the nav-looping branch December 5, 2025 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: feature Adds a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants